package org.pidan.basic.designModel.template;

/**
 * {@code @description}: 模板方法
 * 1
 * {@code @author}: huangyuxin
 * {@code @date}: 2023-11-16
 */
public abstract class RestaurantTemplate {

    //看菜单
    public void lookMenu() {
        System.out.println("看菜单");
    }

    //点菜 -由子类实现
    abstract void spotMenu();

    //吃饭
    public void havingDinner() {
        System.out.println("吃饭");
    }

    //付款 -由子类实现
    abstract void payment();

    //离开
    public void leave() {
        System.out.println("离开");
    }

    /**
     * 模板通用接口
     */
    public void process() {

        lookMenu();
        spotMenu();
        havingDinner();
        payment();
        leave();
    }
}
